From: Colin Walters Date: Tue, 17 Jun 2025 22:11:46 +0000 (-0400) Subject: justfile: Accept args, add build-host shortcuts X-Git-Tag: archive/raspbian/2025.7-2+rpi1^2^2~6^2~4^2~12^2~1 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=f464622946b87031ae372ea8535437ee50339b6b;p=ostree.git justfile: Accept args, add build-host shortcuts Signed-off-by: Colin Walters --- diff --git a/Dockerfile b/Dockerfile index 21cc2ba1..412f21a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,10 +39,15 @@ RUN rpm -e --nodeps ostree{,-libs} COPY --from=build /out/ / COPY --from=src /src/tests-unit-container /tests -# The default final container -FROM $base +# Override userspace +FROM $base as rootfs +# Remove the default binaries to ensure we're getting our overrides RUN rpm -e --nodeps ostree{,-libs} COPY --from=build /out/ / + +# The default final container, with also a regenerated +# initramfs in case ostree-prepare-root changed. +FROM rootfs # https://docs.fedoraproject.org/en-US/bootc/initramfs/#_regenerating_the_initrd # since we have ostree-prepare-root there RUN set -x; kver=$(cd /usr/lib/modules && echo *); dracut -vf /usr/lib/modules/$kver/initramfs.img $kver diff --git a/Justfile b/Justfile index 8e6bf8d2..7dee1287 100644 --- a/Justfile +++ b/Justfile @@ -2,11 +2,15 @@ osid := `. /usr/lib/os-release && echo $ID` # Build the container image from current sources -build: - podman build --jobs=4 -t localhost/ostree . +build *ARGS: + podman build --jobs=4 -t localhost/ostree {{ARGS}} . -build-unittest: - podman build --jobs=4 --target build -t localhost/ostree-buildroot . +build-unittest *ARGS: + podman build --jobs=4 --target build -t localhost/ostree-buildroot {{ARGS}} . + +# Do a build but don't regenerate the initramfs +build-noinitramfs *ARGS: + podman build --jobs=4 --target rootfs -t localhost/ostree {{ARGS}} . # We need a filesystem that supports O_TMPFILE right now (i.e. not overlayfs) # or ostree hard crashes in the http code =/ @@ -35,3 +39,13 @@ unitcontainer: unitcontainer-build # need cap-add=all for mounting podman run --rm --net=none {{unitpriv}} {{unittest_args}} --cap-add=all --env=TEST_CONTAINER=1 localhost/ostree-bintest /tests/run.sh +# Run a build on the host system +build-host: + . ci/libbuild.sh && build + +# Run a build on the host system and "install" into target/inst +# This directory tree can then be copied elsewhere +build-host-inst: build-host + make -C target/c install DESTDIR=$(pwd)/target/inst + tar --sort=name --numeric-owner --owner=0 --group=0 -C target/inst -czf target/inst.tar.gz . +